# Maintainer: Alexander F. Rødseth <xyproto@archlinux.org>
# Contributor: Florian Pritz <bluewind@xinu.at>
# Contributor: domanov <domanov@gmail.com>

pkgname=ditaa
pkgver=0.11.0
pkgrel=3
pkgdesc='Utility for converting ASCII art diagrams into bitmaps'
arch=('any')
url='https://github.com/stathissideris/ditaa'
license=('GPL')
depends=('gsfonts' 'java-runtime')
#makedepends=('apache-ant' 'git' 'java-environment')
source=("https://github.com/stathissideris/$pkgname/releases/download/v$pkgver/$pkgname-$pkgver-standalone.jar"
        $pkgname.sh)
#        "git+https://github.com/stathissideris/$pkgname#tag=v$pkgver"
sha256sums=('9418aa63ff6d89c5d2318396f59836e120e75bea7a5930c4d34aa10fe7a196a9'
            'af6f599cf31f077f67a684e0e847cec3879f580d5e7492a37600af83391ef618')
#            'SKIP'

prepare() {
  local shortver=${pkgver%.0}
  sed -i "s|VERSION|$shortver|" $pkgname.sh
#  local oldver="0_9"
#  local underver=${shortver/./_}
#  sed -i "s|$oldver|${shortver/./_}|" $pkgname/build/release.xml
#  sed -i 's|1.6|1.8|g' $pkgname/build/release.xml
#  mkdir -p $pkgname/{bin,lib}
#  sed -i 's|</javac>|<compilerarg value="-Xlint:unchecked"/></javac>|g' $pkgname/build/release.xml
}

#build() {
#  cd "$pkgname"
#
#  # TODO: Build with leiningen, after moving it from AUR to [community]
#  #ant -buildfile build/release.xml release-jar
#}

package() {
  local shortver=${pkgver%.0}
  install -Dm644 "$srcdir/$pkgname-$pkgver-standalone.jar" \
    "$pkgdir/usr/share/java/$pkgname/$pkgname-$shortver.jar"
  #install -Dm644 "$pkgname/releases/$pkgname$shortver.jar" \
  #  "$pkgdir/usr/share/java/$pkgname/$pkgname-$shortver.jar"
  install -Dm755 $pkgname.sh "$pkgdir/usr/bin/$pkgname"
}

# vim: ts=2 sw=2 et:
